/**
 * Created by HX on 2016/11/4.
 */
var React = require('react');

var ZigbeeTable = React.createClass({
    handleUpdate : function(mac,type,endpoint_id,command){
        this.props.ctrlZigbee(mac,type,endpoint_id,command);
    },
    render : function(){
        var t =this.props.action;

            return (
                <body>
                <button onClick={ this.handleUpdate.bind(this,t.deviceAddress,t.deviceType,t.endpoint_id,"on") }
                            className="btn btn-primary">Open</button>
                &nbsp;
                <button onClick={ this.handleUpdate.bind(this,t.deviceAddress,t.deviceType,t.endpoint_id,"off") }
                            className="btn btn-primary">Close</button>
                </body>
            );
    }
});

module.exports = ZigbeeTable;